package com.runda.biz.dto;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;

import com.bbjob.model.ProductionCodes;

public class MutiCodesDto extends HashMap<String,ArrayList<String>> {

    private static final long serialVersionUID = 1L;
    public List<ProductionCodes> generateCodeList(Integer productId,String codeType){
        if(!this.containsKey(codeType))
            return null;
        List<String> list=this.get(codeType);
        List<ProductionCodes> codeList= list.stream().map(item -> {
            return new ProductionCodes(productId,codeType,item);
        }).collect(Collectors.toList());
        return codeList;
    }
}